﻿using Abp.Application.Services.Dto;
using Choucius.Boilerplate9.Controllers;
using Choucius.Boilerplate9.ProductionLines;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace Choucius.Boilerplate9.Web.Controllers
{
    public class ProductionLinesController : Boilerplate9ControllerBase
    {
        private readonly IProductionLineAppService _productionLineAppService;

        public ProductionLinesController(IProductionLineAppService productionLineAppService)
        {
            _productionLineAppService = productionLineAppService;
        }

        public IActionResult Index()
        {
            return View();
        }

        public async Task<ActionResult> EditModal(Guid productionLineId)
        {
            var productionLineDto = await _productionLineAppService.GetAsync(new EntityDto<Guid>(productionLineId));
            return PartialView("_EditModal", productionLineDto);
        }
    }
}
